/**
 * @Author 韦建韩
 * @Date 2022/8/8
 */
package com.example.devops.config;

import com.example.devops.web.interceptor.PermissionInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
    /**
     * 注册拦截器
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
//        添加拦截器
        registry.addInterceptor(new PermissionInterceptor())
//                定义拦截路径
                .addPathPatterns("/**")
//                定义放行路径
                .excludePathPatterns("/user/**");
    }

}
